package com.lovo.system.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_user")
public class UserDto {

    @TableId(value = "id",type = IdType.AUTO)
    private int id;

    private String userName;

    private String password;

    private String realName;

    @TableField(exist = false)
    private List<RoleDto> roleList;

    public UserDto(String userName, String password, String realName) {
        this.userName = userName;
        this.password = password;
        this.realName = realName;
    }

    public UserDto(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }
}
